import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']='SimHei'#设置中文显示

plt.rcParams['font.size'] = 20
plt.figure(figsize=(6,6))#将画布设定为正方形，则绘制的饼图是正圆

values=[4,24]
plt.pie(values,autopct='%1.1f%%')#绘制饼图

plt.title("4小时",x=0.50,y=0.00,fontdict=dict(fontsize=20,color='gold',weight='bold'))
plt.savefig('7.png', transparent=True)
plt.show()
